package org.project.product.android.pfe.fanta.domain;

import java.io.Serializable;

public class Product implements Serializable {

	private int id;
	private String codBarre;
	private String nom;
	private int idCategory;
	private double poids;
	private String description;
	private double prix;

	public double getPrix() {
		return prix;
	}

	public void setPrix(double prix) {
		this.prix = prix;
	}

	private int quantity;

	public int getQuantity() {
		return quantity;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + (codBarre == null ? 0 : codBarre.hashCode());
		result = prime * result
		        + (description == null ? 0 : description.hashCode());
		result = prime * result + idCategory;
		result = prime * result + (nom == null ? 0 : nom.hashCode());
		long temp;
		temp = Double.doubleToLongBits(poids);
		result = prime * result + (int) (temp ^ temp >>> 32);
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (getClass() != obj.getClass()) {
			return false;
		}
		Product other = (Product) obj;
		if (codBarre == null) {
			if (other.codBarre != null) {
				return false;
			}
		} else if (!codBarre.equals(other.codBarre)) {
			return false;
		}
		if (description == null) {
			if (other.description != null) {
				return false;
			}
		} else if (!description.equals(other.description)) {
			return false;
		}
		if (idCategory != other.idCategory) {
			return false;
		}
		if (nom == null) {
			if (other.nom != null) {
				return false;
			}
		} else if (!nom.equals(other.nom)) {
			return false;
		}
		if (Double.doubleToLongBits(poids) != Double
		        .doubleToLongBits(other.poids)) {
			return false;
		}
		return true;
	}

	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getCodBarre() {
		return codBarre;
	}

	public void setCodBarre(String codBarre) {
		this.codBarre = codBarre;
	}

	public String getNom() {
		return nom;
	}

	public void setNom(String nom) {
		this.nom = nom;
	}

	public int getIdCategory() {
		return idCategory;
	}

	public void setIdCategory(int idCategory) {
		this.idCategory = idCategory;
	}

	public double getPoids() {
		return poids;
	}

	public void setPoids(double poids) {
		this.poids = poids;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Override
	public String toString() {
		return "Product [id=" + id + "]";
	}

}
